<?php

namespace Ruixs\AdminApi\Http\Controllers;

abstract class Controller
{
    protected function success($data = [], $message = 'success', $code = 0)
    {
        return response()->json([
            'code'    => $code,
            'message' => $message,
            'data'    => $data,
        ]);
    }

    protected function error($message = 'error', $code = 1, $data = [])
    {
        return response()->json([
            'code'    => $code,
            'message' => $message,
            'data'    => $data,
        ]);
    }
}
